<template>
  <div class="page">
      <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[20,30]"
      :page-size="20"
      layout="total, sizes, prev, pager, next, jumper"
      :total= "total">
    </el-pagination>
  </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 1,
      limit:20,
      total:0,
    }
  },
  methods: {
      handleSizeChange(val) {
        // console.log(`每页 ${val} 条`);
        this.limit = val
        this.$emit('parentMethod')
      },
      handleCurrentChange(val) {
        // console.log(`当前页: ${val}`);
        this.currentPage = val
        this.$emit('parentMethod')
      }
  }
}
</script>
<style scoped>
.el-pagination {
  margin-top: 20px;
}
</style>